package com.example.server.netty;

import com.example.node.Node;
import com.example.node.Server;
import com.example.factory.DefaultServerFactory;

public class DefaultNettyServerFactory extends DefaultServerFactory {

    private Server server;
    private int port = 9000;

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    @Override
    public Node getNode() {
        if (this.server == null) {
            this.server = new DefaultNettyServer(this.port);
        }
        return this.server;
    }
}
